<?php
/*
# ------------------------------------------------------------------------
# JD Base Theme
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
$form[] = array(
	'#value'=>'<div id="theme-themes">'
);
$html = '';

if(!$_COOKIE['theme-themes-t3-help']){
	$help_style = "style=\"display:block\"";
}else{
	$help_style = "style=\"display:none\"";
}

$html .= '<div id="theme-themes-t3-help" class="ja-inner-help" '.$help_style.'>';


$html .= '<a title="'.t('Hide').'" class="ja-help-close" href="javascript:void(0)" onclick="t3_close_help(this, true)">'.t('Close').'</a>';
$html .= t('<strong>Core themes</strong><br />These themes were developed to help you create your own custom color themes and they stand as sample styling. You cannot delete these themes with the template administration panel.<br /><br /><strong>Local Themes</strong><br />In this section you can see the themes you have previously created. You can delete these themes if you don\'t find them useful anymore.<br /><br /><strong>Upload theme</strong><br />In this section you can upload new themes using an internal upload system. The themes you upload must be packed in a <em>zip</em> archive format.<br /><br /><a target="_blank" href="http://wiki.joomlart.com/wiki/JD_T3_Framework/Guides#Themes_Panel">Click here</a> to learn all about themes management.');
$html .= '</div>';

$form[] = array(
	'#value'=>$html
);

//here is themes tab
$html  = '<div>';

$html .= '<h3>'.t('Core Themes').'</h3>
	     <table class="jd-table-themes jd-admintable core-themes">
			 <thead>
  			 <th>'.t('Name').'</th>	
  			 <th>'.t('Version').'</th>	
  			 <th>'.t('Author').'</th>	
			 </thead>';
if(count($themes['admin_theme']['core'])){
	foreach ($themes['admin_theme']['core'] as $name=>$theme_info){
		
		$html .= '<tr '.$extra_class.'>';
		$html .= '<td>'.t($name).'</td>';
		$html .= '<td>'.t($theme_info->version[0]->data()).'</td>';
		$html .= '<td>'.t($theme_info->author[0]->data()).'</td>';
		
		$html .= '</tr>';
	}
}
			 
$html	.=	 '</table>';

$html .= '<h3>'.t('Local Themes').'</h3>
	     <table class="jd-table-themes jd-admintable local-themes">
			 <thead>
  			 <th>'.t('Name').'</th>
  			 <th>'.t('Version').'</th>	
  			 <th>'.t('Author').'</th>	
  			 <th>'.t('Action').'</th>	
			 </thead>';
if(count($themes['admin_theme']['local'])){
	foreach ($themes['admin_theme']['local'] as $name=>$theme_info){
		
		$html .= '<tr '.$extra_class.'>';
		$html .= '<td>'.t($name).'</td>';
		$html .= '<td>'.t($theme_info->version[0]->data()).'</td>';
		$html .= '<td>'.t($theme_info->author[0]->data()).'</td>';
		
		//process action
		$theme_action = '';
		
		$theme_action = '<span onclick="t3_theme_delete(\''.$name.'\',this)" class="jd-delete">'.t('Delete').'</span>';
		
		$html .= '<td>'.$theme_action.'</td>';
		$html .= '</tr>';
	}
}/*else{
	$html .= '<tr>';
$html .= '<td colspan="4">'.t('There is no theme.').'</td>';
$html .= '</tr>';
}*/

$html	.=	 '</table>';


//upload theme table
$html .= '
	     <table class="jd-table-themes upload-themes">
			 <tr>
  			 <th colspan="2">'.t('Upload theme').'</th>	
			 </tr>
			 <tr>
			 	<td>'.t('Package File').':</td>
			 	<td>
			 		<span id="jd-theme-uploading">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
			 		<div id="sub-theme-uploader">
			 			<noscript>			
							<p>Please enable JavaScript to use file uploader.</p>
						</noscript>
			 		</div>
			 	</td>
			 </tr>
			 ';
$html	.=	 '</table>';
$html 	.=	 '</div>';

$form[] = array(
	'#value'=>$html
);